<?php
/* @var $this PotentialCustomersController */
/* @var $model PotentialCustomers */

$this->breadcrumbs=array(
	'Potential Customers'=>array('index'),
	'Manage',
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#potential-customers-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1><?php echo Yii::t('base','Manage Potential Customers');?></h1>
<?php echo Yii::t('base','<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>')?>

<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->
<a class="btn btn-small create" title="<?php echo Yii::t('base','Create');echo Yii::t('base','Customers');?>" href="<?php echo Yii::app()->request->baseUrl; ?>/potentialCustomers/create"><?php echo Yii::t('base','Create');echo Yii::t('base','Customers');?></a>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'potential-customers-grid',
	'dataProvider'=>$model->search(),
	'itemsCssClass'=>'responsive table table-striped table-bordered',
	'pager'=>array('class'=>'CLinkPager','hiddenPageCssClass'=>'','firstPageCssClass'=>'first paginate_button','firstPageLabel'=>'First','prevPageLabel' => 'Previous','nextPageLabel' => 'Next','lastPageLabel'=>'Last','htmlOptions'=>array('class'=>'dataTables_paginate paging_full_numbers"')),
	'pagerCssClass'=>'pagination pull-right',
	//'filter'=>$model,
	'columns'=>array(
	array('name'=>'potential_customers_id','headerHtmlOptions'=>array('style'=>'width:7%')),
	array('name'=>'potential_customers_list_id','value'=>'PotentialCustomers::model()->getCustomersListName($data->potential_customers_list_id)','headerHtmlOptions'=>array('style'=>'width:14%')),
	array('name'=>'first_name','headerHtmlOptions'=>array('style'=>'width:14%')),
	array('name'=>'last_name','headerHtmlOptions'=>array('style'=>'width:14%')),
	array('name'=>'gender','headerHtmlOptions'=>array('style'=>'width:14%')),
	array('name'=>'mobile','headerHtmlOptions'=>array('style'=>'width:14%')),
		/*
		'email',
		'address',
		'status',
		'post_code',
		'customer_detail1',
		'customer_detail2',
		'customer_detail3',
		'customer_detail4',
		'customer_detail5',
		'customer_detail6',
		'customer_detail7',
		'customer_detail8',
		'customer_detail9',
		'customer_detail10',
		*/
		array(
			'class'=>'CButtonColumn',
			'header'=>Yii::t('base','Operate'),
			'viewButtonImageUrl'=>array('class'=>'gicon-edit'),
			'viewButtonOptions'=>array('class'=>'btn btn-small'),
			'updateButtonImageUrl'=>array('class'=>'gicon-edit'),
			'updateButtonOptions'=>array('class'=>'btn btn-small'),
			'deleteButtonImageUrl'=>array('class'=>'gicon-edit'),
			'deleteButtonOptions'=>array('class'=>'btn btn-inverse btn-small'),
		),
	),
)); ?>
